package chan.com.huishang.ui.fragment;

import android.view.View;
import android.widget.GridView;

import java.util.ArrayList;
import java.util.List;

import chan.com.huishang.R;
import chan.com.huishang.beans.ItemBean;
import chan.com.huishang.iviews.IStudyViews;
import chan.com.huishang.presenter.impl.StudyPresenterImpl;
import chan.com.huishang.ui.adpters.StudyGridViewadpter;
import chan.com.mvplib.factory.CreatePresenter;
import chan.com.mvplib.view.fragment.AbstractFragment;

/**
 * Created by chen on 2017/12/26.
 */
@CreatePresenter(value = StudyPresenterImpl.class)
public class StudyFragment extends AbstractFragment<IStudyViews, StudyPresenterImpl> implements IStudyViews {

    private GridView gv_study;
    private int[] icon_reids = new int[]{R.drawable.xuexixin_icon1, R.drawable.xuexixin_icon2, R.drawable.xuexixin_icon3, R.drawable.xuexixin_icon4};
    private String[] descrps = new String[]{"线下课程", "线上学习", "大咖问答", "专栏学习"};

    List<ItemBean> itemBeen = new ArrayList<>();

    @Override
    protected void findviewbyId(View view) {
        gv_study = (GridView) view.findViewById(R.id.gv_study);

    }

    @Override
    public int getlayoutId() {
        return R.layout.fragment_study;
    }

    @Override
    public void onResume() {
        super.onResume();
        itemBeen.add(new ItemBean("线下课程", R.drawable.xuexixin_icon1));
        itemBeen.add(new ItemBean("线上学习", R.drawable.xuexixin_icon2));
        itemBeen.add(new ItemBean("大咖问答", R.drawable.xuexixin_icon3));
        itemBeen.add(new ItemBean("专栏学习", R.drawable.xuexixin_icon4));
        StudyGridViewadpter viewadpter = new StudyGridViewadpter(itemBeen, getContext());
        gv_study.setAdapter(viewadpter);

    }
}
